/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Dao;

import Model.BitacoraModel;
import Utils.HibernateUtil;
import java.sql.Date;
import org.hibernate.*;

/**
 *
 * @author Thiago
 */
public class BitacoraDaoImp implements BitacoraDao {

    /**
     * @description Salva o log
     * @param bitacora (objeto bitacora)
     * @return
     * @author Thiago Cezar Silverio
     */
    public void save(BitacoraModel bitacora) {
        try {
            Date data = null;
            bitacora.setAcao("INSERT");
            //bitacora.setDatainstrucao(data.getTime());
            bitacora.setScript("INSERT INTO bitacora");
            //
            Session session = HibernateUtil.getSessionFactory().openSession();
            session.beginTransaction();
            session.save(bitacora);
            session.getTransaction().commit();
        } catch (Exception ex) {
            String erro = ex.getMessage();
        }
    }
}
